public class Rectangle {
	private Point p1, p2;
	public Double height;
	public Double width;
	
	/**
	 * Instantiates a new rectangle.
	 *
	 * @param p1 the p1
	 * @param p2 the p2
	 */
	Rectangle(Point p1, Point p2) {
		this.p1 = p1;
		this.p2 = p2;
		setheight();
		setWidth();
	}
	
	/**
	 * Gets the area.
	 *
	 * @return the area
	 */
	public Double getArea() {
		return height * width;
	}
	
	/**
	 * Sets the height.
	 */
	public void setheight()
	{
		this.height = Math.abs(p2.y - p1.y);
	}
	
	/**
	 * Sets the width.
	 */
	public void setWidth()
	{
		this.width= Math.abs(p2.x - p1.x);
	}
	
	/**
	 * Gets the diagonal.
	 *
	 * @return the diagonal
	 */
	public Double getDiagonal() {
		return Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
	}
}
